package com.example.redission.client;

import org.redisson.Redisson;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

public class CustomRedissonClient extends Redisson {

    protected CustomRedissonClient(Config config) {
        super(config);
    }

    @Override
    public RRateLimiter getRateLimiter(String name) {
        return new CustomRedissonRateLimiter(commandExecutor, name);
    }

    /**
     * Create sync/async Redisson instance with provided config
     *
     * @param config for Redisson
     * @return Redisson instance
     */
    public static RedissonClient create(Config config) {
        return new CustomRedissonClient(config);
    }
}
